package com.ruoyi.web.ydz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.ydz.mapper.ClinicalDiseaseMapper;
import com.ruoyi.web.ydz.domain.ClinicalDisease;
import com.ruoyi.web.ydz.service.IClinicalDiseaseService;

/**
 * 临床招募疾病Service业务层处理
 * 
 * @author DRX
 * @date 2024-10-30
 */
@Service
public class ClinicalDiseaseServiceImpl implements IClinicalDiseaseService 
{
    @Autowired
    private ClinicalDiseaseMapper clinicalDiseaseMapper;

    /**
     * 查询临床招募疾病
     * 
     * @param id 临床招募疾病主键
     * @return 临床招募疾病
     */
    @Override
    public ClinicalDisease selectClinicalDiseaseById(Long id)
    {
        return clinicalDiseaseMapper.selectClinicalDiseaseById(id);
    }

    /**
     * 查询临床招募疾病列表
     * 
     * @param clinicalDisease 临床招募疾病
     * @return 临床招募疾病
     */
    @Override
    public List<ClinicalDisease> selectClinicalDiseaseList(ClinicalDisease clinicalDisease)
    {
        return clinicalDiseaseMapper.selectClinicalDiseaseList(clinicalDisease);
    }

    /**
     * 新增临床招募疾病
     * 
     * @param clinicalDisease 临床招募疾病
     * @return 结果
     */
    @Override
    public int insertClinicalDisease(ClinicalDisease clinicalDisease)
    {
        clinicalDisease.setCreateTime(DateUtils.getNowDate());
        return clinicalDiseaseMapper.insertClinicalDisease(clinicalDisease);
    }

    /**
     * 修改临床招募疾病
     * 
     * @param clinicalDisease 临床招募疾病
     * @return 结果
     */
    @Override
    public int updateClinicalDisease(ClinicalDisease clinicalDisease)
    {
        clinicalDisease.setUpdateTime(DateUtils.getNowDate());
        return clinicalDiseaseMapper.updateClinicalDisease(clinicalDisease);
    }

    /**
     * 批量删除临床招募疾病
     * 
     * @param ids 需要删除的临床招募疾病主键
     * @return 结果
     */
    @Override
    public int deleteClinicalDiseaseByIds(Long[] ids)
    {
        return clinicalDiseaseMapper.deleteClinicalDiseaseByIds(ids);
    }

    /**
     * 删除临床招募疾病信息
     * 
     * @param id 临床招募疾病主键
     * @return 结果
     */
    @Override
    public int deleteClinicalDiseaseById(Long id)
    {
        return clinicalDiseaseMapper.deleteClinicalDiseaseById(id);
    }
}
